#include <pspkernel.h>
#include <pspiofilemgr.h>
#include <stdio.h>
#include <stdarg.h>
#include "isomodule.h"

#define MAKE_JUMP(f) (0x08000000 | (((u32)(f) >> 2)  & 0x03ffffff))

typedef struct Directory {
	int level;
	char name[128];
	char path[1024];
} Directory;

typedef struct File {
	char path[1024];
	char name[256];
	u32 addr;
	u32 size;
	PspIoDrvFileArg* arg;
	int fd;
	int seek_cur;
} File;

typedef struct ISO {
	char filename[2048];
	char name[256];
	Directory* dirs;
	File* files;
	int nDirs;
	int nFiles;
} ISO;

ISO* IsoLoad(SceUID fd);
File* IsoGetFile(ISO* iso, const char* filename);

void* geMalloc(int size);
void geFree(void* data);
void* geRealloc(void* last, int size);
void DebugPrint(const char *format, ...);
void ScreenPrintEnable(int e);
